function [Task, status] = PQ_Fetch_Task(PQ, number, priority)
%PQ_Fetch_Task Summary of this function goes here
%   Detailed explanation goes here
status = 0;
Task = PQ.queue(1).task;
Task = Task(2:1);
if (number < 1) || (number > size(PQ.queue, 2))
  return;
end
if ((priority < 1) || (priority == PQ.queue(number).priority))
  Task = PQ.queue(number).task;
  status = 1;
end
end